﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import flash.display.*;
    import flash.geom.*;
    import net.wooga.pets.constants.*;

    public class RenderListView extends Sprite {

        private var _rectangle:Rectangle;

        public function setVisibilityDependingOnPosition(_arg1:Boolean=false):void{
            var _local2:Number;
            var _local3:Number;
            var _local4:Rectangle;
            this._rectangle = getRect(stage);
            if (_arg1){
                _local2 = GameConstants.STAGE_WIDTH;
                _local2 = (_local2 << 1);
                _local3 = GameConstants.STAGE_HEIGHT;
                _local3 = (_local3 << 1);
                _local4 = new Rectangle((-(GameConstants.STAGE_WIDTH) + stage.mouseX), (-(GameConstants.STAGE_HEIGHT) + stage.mouseY), _local2, _local3);
                super.visible = this._rectangle.intersects(_local4);
            } else {
                super.visible = this.isDisplayObjectInStageBounds();
            };
        }
        public function isDisplayObjectInStageBounds():Boolean{
            ((!(this._rectangle)) && ((this._rectangle = getRect(stage))));
            var _local1:Rectangle = new Rectangle(0, 0, GameConstants.STAGE_WIDTH, (GameConstants.STAGE_HEIGHT - GameConstants.MAIN_MENU_HEIGHT));
            return (_local1.intersects(this._rectangle));
        }
        public function show():void{
            this._rectangle = getRect(stage);
            ((this.isDisplayObjectInStageBounds()) && ((visible = true)));
        }
        public function hide():void{
            visible = false;
        }
        public function get rectangle():Rectangle{
            return (this._rectangle);
        }

    }
}//package net.wooga.pets.views.components 
